/***************************************************************************
 创建者: 华磊
 开始时间: 2018.8.14
 copyright: (C) 华友高科
 修改说明: (每次有修改就添加一条，带有 修改人，修改时间，修改描述)
 example (1) hualei 2017.5.8 类的具体实现代码编写

 ***************************************************************************
 *  @file x.h
 *  功能:
 *
 *                                                                         *
 ***************************************************************************/
#ifndef MOVEMAGNETICINSTRUCTIONLOGIC_H
#define MOVEMAGNETICINSTRUCTIONLOGIC_H
#include "instructionEnum.h"
#include "GeneralDefine.h"
#include "moveMagInstruction.h"
#include "fleetdefine.h"

class ProgramSet;
class McControllerThread;
class MoveMagInstruction;
class ProgramEngine;
/**
 * @brief The MoveMagneticInstructionLogic class  指令逻辑处理类
 */
class MoveMagneticInstructionLogic
{
public:
    MoveMagneticInstructionLogic(int robotIdIn, ProgramSet* programSetIn,ProgramEngine* programEngineIn,
                                 McControllerThread *programMcControllerIn);

public:
    E_PROGRAM_LOOP_RESULT startMoveMagnetic(int programNumIn,MoveMagInstruction instructionIn);
    E_PROGRAM_LOOP_RESULT moveMagnetic_run(const MoveMagInstruction instructionIn);
    E_PROGRAM_LOOP_RESULT moveMagnetic_run(const MaganeticPathParameter paraIn);

private:

    void addMsg( int messageLevel,
                 std::string componentName,
                 std::string messageType,
                 int messageCode,
                 int robotId,
                 int parameter1 = 0,
                 int parameter2 = 0,
                 int parameter3 = 0,
                 int parameter4 = 0,
                 QString message= "");

private:
    int robotId;
    ProgramSet* programSet;
    /**
     * @brief programMcController       算法线程指针
     */
    McControllerThread *programMcController;
    ProgramEngine* programEngine;

    int passedStationId;//最后经过的站点id，负数代表未知
    int nextStationId;//下一个站点id，负数代表未知
    int currentStationId;//当前所在的站点id，负数表示不在站点
    int passedPathId;//最后经过的路径id，负数代表未知
    int nextPathId;//下一个路径id，负数代表未知
    int currentPathId;//当前所处的路径id，负数表示不在任何路径
};

#endif // MOVEMAGNETICINSTRUCTIONLOGIC_H
